<template>
  <div>
    <div @click="Return"></div>
    <a-row :gutter="12">
      <a-col :span="8">
        <ant-card>
          <template #content>
            <ant-tree
              :treeData="treeData"
              checkable
              @Delete="Delete"
              @AddTop="AddTop"
              @SelectTree="SelectTree"
              @AddChild="AddChild"
              :action="action"
            />
          </template>
        </ant-card>
      </a-col>
      <a-col :span="16">
        <ant-card>
          <template #content>
            <ant-details :selectData="selectData" />
          </template>
        </ant-card>
      </a-col>
    </a-row>
  </div>
</template>
<script lang="ts">
const AntCard = () =>
  import("../../../components/Card.vue").then(m => m.default || m);
const AntDetails = () => import("./Details.vue").then(m => m.default || m);
import { Component, Vue, Prop, Emit } from "vue-property-decorator";

@Component({
  name: "open-menu",
  layout: "menu",
  components: {
    AntCard,
    AntDetails
  }
})
export default class OpenMenu extends Vue {
  selectData: string[] = [];
  action: boolean = true;
  treeData: any[] = [
    //首页
    {
      path: "/LeaveHome",
      name: "LeaveHome",
      title: {
        zh: "首页",
        mn: "ᠺᠠᠷᠳ ᠤ ᠨᠡᠷ᠎ᠡ",
        en: ""
      },
      key: "32",
      authentication: "LeaveHome"
    },
    //请假系统设置
    {
      path: "/LeaveSystemSetting",
      name: "LeaveSystemSetting",
      title: {
        zh: "请假系统设置",
        mn: "ᠺᠠᠷᠳ ᠤ ᠨᠡᠷ᠎ᠡ",
        en: ""
      },
      key: "33",
      authentication: "LeaveSystemSetting",
      children: [
        //请假细则设置
        {
          path: "LeaveLeaveRules",
          title: {
            zh: "请假细则设置",
            mn: "ᠺᠠᠷᠳ ᠤ ᠨᠡᠷ᠎ᠡ",
            en: ""
          },
          key: "34",
          authentication: "LeaveLeaveRules",
          name: "LeaveLeaveRules",
          children: [
            {
              path: "LeaveLeaveRules1",
              title: {
                zh: "请假细则设置111111",
                mn: "ᠺᠠᠷᠳ ᠤ ᠨᠡᠷ᠎ᠡ",
                en: ""
              },
              key: "34111",
              authentication: "LeaveLeaveRule111s",
              name: "LeaveLeaveRules11"
            }
          ]
        }
      ]
    }
  ];
  Return() {
    const _this: any = this;
    _this.$router.push({
      name: "SysModule"
    });
  }
  //批量删除
  Delete(n: string[]) {
    console.log("批量删除", n);
  }
  //添加顶级
  AddTop() {
    console.log("添加顶级");
  }
  //添加子集
  AddChild(val: string[]) {
    console.log("添加的", val);
  }
  //选择的值
  SelectTree(val: string[]) {
    this.selectData = val;
  }
}
</script>
